<?php
/**
 * @category     Inchoo
 * @package     Inchoo Featured Products
 * @authors    Mladen Lotar <mladen.lotar@surgeworks.com>, Vedran Subotic <vedran.subotic@surgeworks.com>
 */
?>
<?php if (($_products = $this->getProductCollection()) && $_products->getSize()): ?>
	<h3><?php echo $this->__($this->getBlockLabel()) ?></h3>
	<table border="0" cellspacing="0">

		<tbody>

		<?php $i=0;$row=0; foreach ($_products->getItems() as $_product): ?>

			<?php if($i==0):?>
				<?php $row++;?>
				<tr class="<?php echo (($row%2)>0) ? 'odd' : 'even' ?>">
			<?php endif;?>
					<td>

						<a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->htmlEscape($_product->getName()) ?>">
							<img class="product-img" src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(80, 80) ?>" alt="<?php echo $this->htmlEscape($_product->getName()) ?>" />
						</a>
						<div class="product-description">
							<p>
								<a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->htmlEscape($_product->getName()) ?>)">
									<?php echo $this->htmlEscape($_product->getName()) ?>
								</a>
							</p>
							<?php echo $this->getReviewsSummaryHtml($_product, 'short') ?>
							<?php echo $this->getPriceHtml($_product, true, '-new') ?>

							<?php if($_product->isSaleable()): ?>
								<button type="button" class="button btn-cart" onclick="setLocation('<?php echo $this->getAddToCartUrl($_product) ?>')"><span><span><?php echo $this->__('Add to Cart') ?></span></span></button>
							<?php else: ?>
								<div class="out-of-stock"><?php echo $this->__('Out of stock') ?></div>
							<?php endif; ?>

						</div>
					</td>

			<?php $i++; if($i==$this->getItemsPerRow()):?>
				<?php $i=0;?>
				</tr>
			<?php endif;?>
		<?php endforeach; ?>

		</tbody>

	</table>
<?php endif; ?>